package main

func f() int {
	a := 0
	a++
	//defer函数的实参在注册时通过值拷贝传递进去
	defer func(i int) {
		println("defer i=", i)
	}(a)

	a++
	return a

}

func main() {
	f();
}
